package com.hinnotek.amoeba.adapters.old

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.bean.old.SellPurEntity

class SellProjectRequirementsDetailAdapter(data: MutableList<SellPurEntity>?) :
    BaseMultiItemQuickAdapter<SellPurEntity, BaseViewHolder>(data) {
    protected override fun convert(holder: BaseViewHolder, item: SellPurEntity) {
        when (item.type) {
            0 -> {
                holder.setText(R.id.tv_device_name, item.amibaPurchaseProjects?.productName)
                holder.setText(
                    R.id.tv_specification_model,
                    item.amibaPurchaseProjects?.productTypeName
                )
                holder.setText(
                    R.id.tv_quantity_to_be_purchased,
                    item.amibaPurchaseProjects?.productNum.toString()
                )
            }
            1 -> holder.setText(R.id.tv_note, item.note)
        }
    }

    init {
        addItemType(0, R.layout.item_sell_project_requirement_detail_layout)
        addItemType(1, R.layout.include_note)
    }
}